package com.cgbl.cg.adapter

import com.blankj.utilcode.util.ColorUtils
import com.blankj.utilcode.util.NumberUtils
import com.blankj.utilcode.util.SpanUtils
import com.blankj.utilcode.util.TimeUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.cgbl.cg.R
import com.cgbl.cg.utils.city.DoubleUtils
import com.robot.base.model.CouponBean

class SelectCouponAdapter :
    BaseQuickAdapter<CouponBean, BaseViewHolder>(R.layout.app_item_select_coupon) {

    override fun convert(holder: BaseViewHolder, item: CouponBean) {
        holder.setText(R.id.tv_coupon_price, "￥" + DoubleUtils.replace(item.couponPrice))
//        holder.setText(R.id.tv_coupon_desc, "满${DoubleUtils.replace(item.useMinPrice)}减${DoubleUtils.replace(item.couponPrice)}")
        holder.setText(R.id.tv_coupon_desc, item.couponTitle)
        holder.setText(R.id.tv_coupon_name, "" + item.couponTitle)
        holder.setText(
            R.id.tv_coupon_date,
            "有效期至${TimeUtils.millis2String(item.endTime?.toLong() ?: 0, "yyyy-MM-dd")}"
        )
    }
}